package cn.swh.guguanjia.mapper;

import cn.swh.guguanjia.entity.SysOffice;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;
import java.util.Map;

@org.apache.ibatis.annotations.Mapper
public interface SysOfficeMapper extends Mapper<SysOffice> {

    @SelectProvider(type =SysOfficeProvider.class ,method = "selectPage")
    List<SysOffice> selectPage(Map<String,Object> map);


    @Select("select " +
            " sof.*  " +
            "FROM " +
            " sys_role_office sro, " +
            " sys_office sof  " +
            "where " +
            " sro.role_id = #{rid}  " +
            " AND sof.del_flag = 0  " +
            " AND sro.office_id = sof.id")
    List<SysOffice> selectById(long rid);
}